package it.koutifaris.travianmap.dal.sqlservices.tile;

import it.koutifaris.travianmap.dal.sqlservices.MapSqlContract.Alliances;
import it.koutifaris.travianmap.dal.sqlservices.MapSqlContract.Players;
import it.koutifaris.travianmap.dal.sqlservices.MapSqlContract.Villages;

class VillageQuery {

	static String getVillagesBaseQuery() {
		return "SELECT "
				+ Villages.TABLE_NAME + "." + Villages.COLUMN_NAME_REVISION_ID + " AS " + Villages.COLUMN_NAME_REVISION_ID + ", "
				+ Villages.COLUMN_NAME_VILLAGE_ID + ", "
				+ Villages.COLUMN_NAME_VILLAGE_NAME + ", "
				+ Villages.COLUMN_NAME_X + ", "
				+ Villages.COLUMN_NAME_Y + ", "
				+ Villages.COLUMN_NAME_POPULATION + ", "
				+ Players.COLUMN_NAME_PLAYER_ID + ", "
				+ Players.COLUMN_NAME_PLAYER_NAME + ", "
				+ Players.COLUMN_NAME_TRIBE + ", "
				+ Alliances.TABLE_NAME + "." + Alliances.COLUMN_NAME_ALLIANCE_ID + ", "
				+ Alliances.COLUMN_NAME_ALLIANCE_NAME + " "
				+ "FROM "
				+ Villages.TABLE_NAME + ", "
				+ Players.TABLE_NAME + ", "
				+ Alliances.TABLE_NAME + " "
				+ "WHERE "
				+ Villages.COLUMN_NAME_OWNER_ID + " = " + Players.COLUMN_NAME_PLAYER_ID + " AND "
				+ Players.TABLE_NAME + "." + Players.COLUMN_NAME_ALLIANCE_ID + " = "
				+ Alliances.TABLE_NAME + "." + Alliances.COLUMN_NAME_ALLIANCE_ID + " AND "
				+ Villages.TABLE_NAME + "." + Villages.COLUMN_NAME_REVISION_ID + " = ? AND "
				+ Players.TABLE_NAME + "." + Players.COLUMN_NAME_REVISION_ID + " = ? AND "
				+ Alliances.TABLE_NAME + "." + Alliances.COLUMN_NAME_REVISION_ID + " = ?";
	}

}
